[IA64] move evtchn_vector to shared_info
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Mon, 15 May 2006 16:53:23 +0000 (10:53 -0600)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Mon, 15 May 2006 16:53:23 +0000 (10:53 -0600)
Move evtchn_vector from vcpu_info to shared_info.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c
linux-2.6-xen-sparse/arch/ia64/xen/hypercall.S
tools/libxc/xc_ia64_stubs.c
tools/libxc/xc_linux_build.c
xen/arch/ia64/xen/domain.c
xen/arch/ia64/xen/hypercall.c
xen/arch/ia64/xen/vcpu.c
xen/include/asm-ia64/event.h
xen/include/public/arch-ia64.h

index 1e7df722d065b7e868dffb9bd14fcd978bba8780..08cb9be3365087a4ab7fc6e18ecfb3c814935286 100644 (file)
@@ -246,25 +246,14 @@ static struct irqaction evtchn_irqaction = {
        .name =         "xen-event-channel"
 };
 
-int evtchn_irq = 0xe9;
+static int evtchn_irq = 0xe9;
 void __init evtchn_init(void)
 {
     shared_info_t *s = HYPERVISOR_shared_info;
-    vcpu_info_t   *vcpu_info = &s->vcpu_info[smp_processor_id()];
 
-#if 0
-    int ret;
-    irq = assign_irq_vector(AUTO_ASSIGN);
-    ret = request_irq(irq, evtchn_interrupt, 0, "xen-event-channel", NULL);
-    if (ret < 0)
-    {
-       printk("xen-event-channel unable to get irq %d (%d)\n", irq, ret);
-       return;
-    }
-#endif
     register_percpu_irq(evtchn_irq, &evtchn_irqaction);
 
-    vcpu_info->arch.evtchn_vector = evtchn_irq;
+    s->arch.evtchn_vector = evtchn_irq;
     printk("xen-event-channel using irq %d\n", evtchn_irq);
 
     spin_lock_init(&irq_mapping_update_lock);
index 7075f445eda568f59958b184d389e175eef5328f..f675a8441c400fae80e0a95af2f52e0fb4f3784a 100644 (file)
@@ -247,7 +247,7 @@ GLOBAL_ENTRY(xen_set_kr)
        XEN_RESTORE_PSR_IC
        ;;
        br.ret.sptk.many rp
-END(xen_set_rr)
+END(xen_set_kr)
 
 GLOBAL_ENTRY(xen_fc)
        movl r8=running_on_xen;;
index a65dd5afb97a8eb7d50e01c8f2890da6d2ced8fb..97da325f0335868b16625d4081504327f93610fa 100644 (file)
@@ -723,7 +723,7 @@ int xc_hvm_build(int xc_handle,
 
     ctxt->flags = VGCF_VMX_GUEST;
     ctxt->regs.cr_iip = 0x80000000ffffffb0UL;
-    ctxt->vcpu.privregs = 0;
+    ctxt->privregs = 0;
 
     memset( &launch_op, 0, sizeof(launch_op) );
 
index 4c0d655855f6a65bf073b8c49e9bb418346f655d..47cb7950dd686d1f0b0a193bf6b6b19e14193a9e 100644 (file)
@@ -1114,7 +1114,7 @@ static int xc_linux_build_internal(int xc_handle,
     ctxt->regs.ar_fpsr = xc_ia64_fpsr_default();
     /* currently done by hypervisor, should move here */
     /* ctxt->regs.r28 = dom_fw_setup(); */
-    ctxt->vcpu.privregs = 0;
+    ctxt->privregs = 0;
     ctxt->sys_pgnr = 3;
     i = 0; /* silence unused variable warning */
 #else /* x86 */
index 11cac65714f88417449bb5d66af8877e90bb1cac..032e825140e440f1aac43a0d22d8f5de4731338d 100644 (file)
@@ -269,11 +269,7 @@ fail_nomem:
 
 void arch_getdomaininfo_ctxt(struct vcpu *v, struct vcpu_guest_context *c)
 {
-       struct pt_regs *regs = vcpu_regs (v);
-
-       c->regs = *regs;
-       c->vcpu.evtchn_vector = v->vcpu_info->arch.evtchn_vector;
-
+       c->regs = *vcpu_regs (v);
        c->shared = v->domain->shared_info->arch;
 }
 
@@ -312,11 +308,10 @@ int arch_set_info_guest(struct vcpu *v, struct vcpu_guest_context *c)
        }
        new_thread(v, regs->cr_iip, 0, 0);
 
-       v->vcpu_info->arch.evtchn_vector = c->vcpu.evtchn_vector;
-       if ( c->vcpu.privregs && copy_from_user(v->arch.privregs,
-                          c->vcpu.privregs, sizeof(mapped_regs_t))) {
+       if ( c->privregs && copy_from_user(v->arch.privregs,
+                          c->privregs, sizeof(mapped_regs_t))) {
            printk("Bad ctxt address in arch_set_info_guest: %p\n",
-                  c->vcpu.privregs);
+                  c->privregs);
            return -EFAULT;
        }
 
index d1875f275a15bf785c0152040431d6ad7da6e312..56c410f8bfc000ccb46b912a0a8868b54266160a 100644 (file)
@@ -153,9 +153,6 @@ fw_hypercall_ipi (struct pt_regs *regs)
                c.regs.cr_iip = targ_regs->cr_iip;
                c.regs.r1 = targ_regs->r1;
                
-               /* Copy from vcpu 0.  */
-               c.vcpu.evtchn_vector =
-                       current->domain->vcpu[0]->vcpu_info->arch.evtchn_vector;
                if (arch_set_info_guest (targ, &c) != 0) {
                        printf ("arch_boot_vcpu: failure\n");
                        return;
index 9052010444f350fb7a4b5e6813f6718f37d15288..0ad69f9de99d340c4674bc55375438c48fba4511 100644 (file)
@@ -682,9 +682,9 @@ UINT64 vcpu_check_pending_interrupts(VCPU *vcpu)
         */
 check_start:
        if (event_pending(vcpu) && 
-               !test_bit(vcpu->vcpu_info->arch.evtchn_vector,
+               !test_bit(vcpu->domain->shared_info->arch.evtchn_vector,
                        &PSCBX(vcpu, insvc[0])))
-               vcpu_pend_interrupt(vcpu, vcpu->vcpu_info->arch.evtchn_vector);
+               vcpu_pend_interrupt(vcpu, vcpu->domain->shared_info->arch.evtchn_vector);
 
        p = &PSCBX(vcpu,irr[3]);
        r = &PSCBX(vcpu,insvc[3]);
index 32afe397950f5a48d5026370191fa22c08922999..31bd169e5952a58c1c2cec4b06d0e94acf194ea7 100644 (file)
@@ -29,7 +29,7 @@ static inline void evtchn_notify(struct vcpu *v)
         smp_send_event_check_cpu(v->processor);
 
     if(!VMX_DOMAIN(v))
-       vcpu_pend_interrupt(v, v->vcpu_info->arch.evtchn_vector);
+       vcpu_pend_interrupt(v, v->domain->shared_info->arch.evtchn_vector);
 }
 
 /* Note: Bitwise operations result in fast code with no branches. */
index 36f161abfe8c904fa177756d1cdd4c2ce83b53cf..19716fe79b9b85e64fec6b00750ce4ba0fc50e48 100644 (file)
@@ -293,8 +293,6 @@ typedef struct {
 } mapped_regs_t;
 
 typedef struct {
-    mapped_regs_t *privregs;
-    int evtchn_vector;
 } arch_vcpu_info_t;
 
 typedef mapped_regs_t vpd_t;
@@ -302,6 +300,9 @@ typedef mapped_regs_t vpd_t;
 typedef struct {
     unsigned int flags;
     unsigned long start_info_pfn;
+
+    /* Interrupt vector for event channel.  */
+    int evtchn_vector;
 } arch_shared_info_t;
 
 typedef struct {
@@ -321,7 +322,7 @@ typedef struct vcpu_guest_context {
     unsigned long vm_assist;   /* VMASST_TYPE_* bitmap, now none on IPF */
 
     cpu_user_regs_t regs;
-    arch_vcpu_info_t vcpu;
+    mapped_regs_t *privregs;
     arch_shared_info_t shared;
     arch_initrd_info_t initrd;
     char cmdline[IA64_COMMAND_LINE_SIZE];